
const initalState = {
    username:'',
    role:'',
}
export default function useUserMessage(state = initalState,action){
    switch (action.type) {
        case 'login':
            return {username:action.username,role:action.role}
        case 'cancleLogin':
            return {username:'',role:''}
        default:
            return state
    }
} 